export function getData(val) {
  // https://jsonplaceholder.typicode.com/todos/1
  return new Promise((fullfilled) => {
    fetch(`https://jsonplaceholder.typicode.com/todos/${val}`).then((res) => {
      console.log(
        res.json().then((r) => {
          if (val == 2) {
            setTimeout(() => {
              fullfilled(r)
            }, 3000)
          } else {
            fullfilled(r)
          }
        }),
      )
    })
  })
}
